/*-------------------------------- Arctic Core ------------------------------
 * Copyright (C) 2013, ArcCore AB, Sweden, www.arccore.com.
 * Contact: <contact@arccore.com>
 *
 * You may ONLY use this file:
 * 1)if you have a valid commercial ArcCore license and then in accordance with
 * the terms contained in the written license agreement between you and ArcCore,
 * or alternatively
 * 2)if you follow the terms found in GNU General Public License version 2 as
 * published by the Free Software Foundation and appearing in the file
 * LICENSE.GPL included in the packaging of this file or here
 * <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>
 *-------------------------------- Arctic Core -----------------------------*/


#ifndef CAN_TYPES_H_
#define CAN_TYPES_H_

#include "types.h"


#define CAN_LOG_EN 1
#if CAN_LOG_EN
#include "mid_debug.h"
#define LogMask_CAN  ((ELOG_Error | ELOG_Warning | ELOG_Trace | ELOG_Info) & LogMask_Globle)
#define can_log_array(type,tag, arr,arr_len) if ((type) & LogMask_CAN) Mid_Debug_Sprintf_u8Array(type, tag, arr,arr_len)
#define can_log(type, formate, ...) if ((type) & LogMask_CAN) DBUG_OUT(type, "can_log", formate, ##__VA_ARGS__)
#else
#define can_log(type, formate, ...)  (void*)0
#endif

#define CANNM_LOG_EN 1
#if CANNM_LOG_EN
#include "mid_debug.h"
#define LogMask_canNm  ((ELOG_Error | ELOG_Warning | ELOG_Trace | ELOG_Info) & LogMask_Globle)
#define CANNM_DEBUG(type, formate, ...) if ((type) & LogMask_CAN) DBUG_OUT(type, "can_log", formate, ##__VA_ARGS__)
#else
//#define CANNM_DEBUG(type, formate, ...)  (void*)0
#define CANNM_DEBUG(type, formate, ...)  if ((type) & LogMask_CAN) ;

#endif

#define CANTP_LOG_EN 0
#define LogMask_canTp ((ELOG_Error | ELOG_Warning | ELOG_Trace /*| ELOG_Debug*/) & LogMask_Globle)
#if CANTP_LOG_EN
#include "mid_debug.h"
#define CANTP_DEBUG(type,tag, formate, ...) if ((type) & LogMask_canTp) DBUG_OUT(type, tag, formate, ##__VA_ARGS__)
#else
#define CANTP_DEBUG(type,tag, formate, ...) if ((type) & LogMask_canTp) ;
#endif

#define PDUR_LOG_EN 1
#if PDUR_LOG_EN
#include "mid_debug.h"
#define LogMask_pduR ((ELOG_Error | ELOG_Warning | ELOG_Trace /*| ELOG_Debug*/) & LogMask_Globle)
#define PDUR_DEBUG(type,tag, formate, ...) if ((type) & LogMask_pduR) DBUG_OUT(type, tag, formate, ##__VA_ARGS__)
#else
#define PDUR_DEBUG(type,tag, formate, ...) (void*)0
#endif


#define DCM_LOG_EN 1
#if DCM_LOG_EN
#include "mid_debug.h"
#define LogMask_DCM ((ELOG_Error | ELOG_Warning | ELOG_Trace | ELOG_Info) & LogMask_Globle)
#define dcm_log(type, tag, formate, ...) if ((type) & LogMask_DCM) DBUG_OUT(type, tag, formate, ##__VA_ARGS__)
#else
#define dcm_log(type, tag, formate, ...)  (void*)0
#endif

#include "ComStack_Types.h"

#endif /* CAN_TYPES_H_ */

